package org.example.educms.controller;

import org.example.ResultCode.R;
import org.example.educms.entity.CrmBanner;
import org.example.educms.service.CrmBannerService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/educms/bannerfront")//用户使用
@CrossOrigin
public class BannerFrontController {
    @Autowired
    private CrmBannerService bannerService;
@GetMapping("getAllBanner")
public R getAllBanner(){
//根据banner的id进行降序排列,显示排列之后的前两条记录
    List<CrmBanner> list=bannerService.selectAllBanner();
    return R.ok().data("list",list);

}
}
